<template>
  <div>
    姓名<input type="text" v-model="name" />
    <hr />
    姓名 <input type="text" v-model="usname.name" /> 年龄<input
      type="text"
      v-model="usname.age"
    />
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "",
      usname: {
        name: "",
        age: "",
      },
    };
  },
  watch: {
    name(newval, odrval) {
      console.log(newval, odrval);
    },
    usname: {
      handler() {
        // console.log(newval, odrval);
        console.log(this.usname);
      },
      deep: true,
      immediate:true
    },
  },
};
</script>

<style>
</style>